package com.cljz.makepassenger.ui.adapter;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

import com.cljz.makepassenger.ui.fragment.SendOrReceiveInviteFragment;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by apple on 2017/4/27.
 */

public class InvitePagerAdapter extends FragmentPagerAdapter {
    private List<String> isInviteList;

    public InvitePagerAdapter(FragmentManager fm) {
        super(fm);
        isInviteList = new ArrayList<>();
        isInviteList.add("send");
        isInviteList.add("recive");
    }

    @Override
    public Fragment getItem(int position) {
        SendOrReceiveInviteFragment sendOrReceiveInviteFragment = SendOrReceiveInviteFragment.newInstance(isInviteList.get(position));
        return sendOrReceiveInviteFragment;
    }

    @Override
    public int getCount() {
        return isInviteList == null ? 0 : isInviteList.size();
    }
}
